﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Reddit.Data
{
    [DataContract]
    public class Story
    {
        [DataMember]
        public string domain { get; set; }
        [DataMember]
        public bool clicked { get; set; }
        [DataMember]
        public string name { get; set; }
        [DataMember]
        public string author { get; set; }
        [DataMember]
        public string url { get; set; }
        [DataMember]
        public int num_comments { get; set; }
        [DataMember]
        public int downs { get; set; }
        [DataMember]
        public double created { get; set; }
        [DataMember]
        public double created_utc { get; set; }

        private string _subreddit_id;
        [DataMember]
        public string subreddit_id 
        {
            get { return _subreddit_id; }
            set { _subreddit_id = Util.NameToId(value); }
        }
        [DataMember]
        public string subreddit { get; set; }
        [DataMember]
        public int score { get; set; }
        [DataMember]
        public bool? likes { get; set; }
        [DataMember]
        public string id { get; set; }
        [DataMember]
        public string title { get; set; }
        [DataMember]
        public bool hidden { get; set; }
        [DataMember]
        public bool saved { get; set; }
        [DataMember]
        public int ups { get; set; }
    }
}
